<%-- 
    Document   : connect
    Created on : Jun 12, 2013, 1:19:07 PM
    Author     : Anna SAELEE
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <body>
        <div class="workspace1">
            <% if (session.getAttribute("username") == null) {%>
            <form method="post" action="Login" name="formLogin">
                <h3>Connecter</h3>
                <p>Username:
                    <input type="text" name="username"/><br>
                    Mot de passe: <input type="password" name="passwd"/><br>
                </p>
                <p>
                    <input name="login" type="submit" id="login" value="Connecter"/>
                </p>
            </form>
            <br/>
            <% } else {
                    String username = (String) session.getAttribute("username");
                    session.setAttribute("username", username);
                    out.println("Bienvenue: " + session.getValue("username"));
                    out.println("<br/>");
                    out.println("<form method=\"get\" action=\"Login\" name=\"formLogout\">");
                    out.println("<input name=\"logout\" type=\"submit\" id=\"logout\" value=\"Déconnecter\"/>");
                    out.println("</form><br/>");
                }
            %>       
            <%@include file="menu.jsp" %>
        </div>
    </body>
</html>
